#ifndef _UBT_STATE_TASK_MAP_H_
#define _UBT_STATE_TASK_MAP_H_
#include "ubt_state_types.h"

namespace ubt_state
{
class CTaskMap: public ITask
{
  public:
    static ITask *CreateTask(ITaskCb *pTaskCb, std::string taskId, void *pvReq);
    CTaskMap(ITaskCb *pTaskCb, std::string taskId, void *pvReq);
    ~CTaskMap();

    virtual bool Start();
    virtual void Pause();
    virtual void Continue();
    virtual void Stop(int reason);

    virtual void OnTimer();
    virtual void OnMsg(int msgType, void *pvMsg);

    virtual ubt_task_type GetType();
    virtual ubt_task_state GetState();
    virtual ubt_task_stage GetStage();
    virtual std::string GetActionType();
    virtual void GetIndex(int& index, int& reportIndex);
    virtual void GetStopInfo(int& stopReason, std::string& stopReasonDesc);
    virtual void GetLogs(std::vector<TaskLogItem>& logs);

  private:

    ITaskCb *_pTaskCb;
    std::string _taskId;
    ubt_task_state _state;
    int _obstacleState;
    int _stopReason;
    std::string _stopReasonDesc;
};

}
#endif

